<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册</title>
</head>
<body>
	<form action="<c:url value="/RegistServlet" ></c:url>" method="post">
		<div id="form-content">
			<div class="form-line">用户名：<input name="username" type="text" value="${requestScope.user.username }"/><span style="color:red">${errors.username}</span></div>
			<div class="form-line">密&ensp;&ensp;码：<input name="password" type="text" value="${requestScope.user.password }"/><span style="color:red">${errors.password}</span></div>
			<div class="form-line">出生年月：<input name="birthday" type="text" value="${requestScope.user.birthday }"/><span style="color:red">${errors.username}</span></div>
			<div class="form-line">验证码：<input name="verifycode" type="text" value="${requestScope.user.verifycode }"/><span style="color:red">${errors.verifycode}</span><c:if test="${! empty verifyerror}"><span style="color:red">${verifyerror}</span></c:if></div>
			<div class="form-line img"><img alt="" id="img" src="<c:url value="/VerifyCodeServlet"></c:url>"><a id="a_img" href="javascript:void(0)" onClick="fnGetNextImg()">换一张</a></div>
			<c:if test="${! empty msg}"><h1 style="color:red;">${requestScope.msg}</h1></c:if>
			<div class="form-line button"><input type="submit" value="注册"></div>
		</div>
	</form>
</body>
<script>
	function fnGetNextImg(){
		console.log(document.getElementById("img"));
		document.getElementById("img").src = "<c:url value="/VerifyCodeServlet?random="></c:url>" + new Date().getTime(); 
	}
</script>
<style>
	#form-content{
		margin: 0 auto;
		width: 100%;
	}
	.form-line{
		height:35px;
		line-height:35px;
	}
	.img{
		padding-left:60px;
		height:60px;
		line-height:60px;
	}
	#a_img{
		
	}
	.button{
		margin:0;
	}
</style>
</html>